<?php $id="form_".uniqid();?>
<table id="<?php echo $id;?>"></table>
<script>
$('#<?php echo $id?>').DataSource({url:'stats/getexchange',fields:[[
	{field:'goods_title',         title:'商品名称', width:190},	
	{field:'views',               title:'人气指数', width:80},
	{field:'goods_amount',        title:'购买次数', width:80},
	{field:'goods_price',         title:'购物率', width:120}	   
    ]], tools:[
	{instant:false},
	<?php if(in_array('EXPORT',$auth)){?>
	{text:'导出',iconCls:'icon-large-chart',handler:function(){
			var params=$('#<?php echo $id?>').DataSource('queryParams');
			Core.Export(params,'monthorder/export');
	}},
	<?php }?>
	'|',
		{type:'combobox',text:'付款状态',width:100,name:'order_status',value:'', items:'<option value="">所有类型</option><option value="1">未付款</option><option value="2">已付款</option><option value="3">挂帐</option><option value="4">已取消</option>'},
		{type:'datebox', text:'开始日期', width:100,name:'qaddtime',value:'<?php echo date('Y-m-d')?>'},
		{type:'datebox', text:'结束日期', width:100,name:'zaddtime',value:'<?php echo date('Y-m-d')?>'},
		{text:"搜索", iconCls:"icon-search", handler:function(){
			$('#<?php echo $id?>').DataSource('search');
		}},
	'-'
	],
	footer:true
});
</script>
